package com.heima.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_sku")
public class Sku implements Serializable {
    @TableId(value = "sku_id",type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)//把当前字段转换为字符串进行响应
    private Long skuId;
    private String skuName;//商品名称
    private String skuImage;//商品图片
    private Integer price;//基础价格
    private Long classId;//商品类别Id
    private Integer isDiscount; //是否打折促销
    private String unit;//净含量
    private String brandName;//品牌名称
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
